<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>访问属性</title>
    <script type="text/javascript" src="../js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
            $("img").click(function(){
               console.log("src属性值:"+$(this).attr("src"));
               $(this).attr("src","../images/3.jpg");
            });
            $("input").blur(function(){
                console.log("type属性值:"+$(this).attr("type"));
                console.log("id属性值:"+$(this).attr("id"));
                console.log("value属性值:"+$(this).attr("value"));
                // $(this).attr("type","password")
                // $(this).attr("value","123456");
                console.log("服务器值(value属性值):"+$(this).val());
                $(this).val("123456");
            });
        })
    </script>
</head>
<body>
<img src="../images/heihei.gif" alt=""><br>
用户名:<input type="text" id="username" value="admin">
</body>
</html>